Skip to content

fix(github): fix issue templates, auto-labeling, and moderator workflows - #2944

Open
7ui77 wants to merge 17 commits into
lnreader:masterfrom
7ui77:fix/issue-templates-and-label-workflows
Open

7ui77 wants to merge 17 commits into
lnreader:masterfrom
7ui77:fix/issue-templates-and-label-workflows

Conversation

@7ui77

@7ui77 7ui77 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Checklist

  • Update version code if an existing plugin was modified (N/A — workflow, issue template, and dev tooling changes only)
  • Test changes in Plugin Playground or the app (verified via pnpm run check:github / pnpm run test:scripts [56/56], CLI smoke tests, ESLint/Prettier, Python YAML/schema validation, and actionlint)
  • Reference related issues in the PR body (proactive maintenance audit; fixes root causes observed on e.g. NovelBuddy JSON Parse error #2296, 69shuba(chinese) #1866)
  • Commit messages follow type(scope): description

Summary

.github/
├── scripts/
│   ├── issue-parsing.cjs                  # shared heading, severity, author/repo/label validation & plugin matcher helpers
│   ├── site-reachability.cjs              # pre-connection SSRF-pinned curl probing (multi-IP failover), reachability, UA fetch, live-issue guard & theme detection
│   ├── site-reachability.test.cjs         # 6 unit/integration tests (multi-IP failover, 3xx reachability, SSRF pinning, theme probes, close API)
│   ├── close-invalid-issue.cjs            # shared invalid-label + comment + not_planned close helper
│   ├── validate-github-yaml.py            # shared UniqueKeyLoader + Issue Form schema validator for CI and local check:github
│   ├── check-github.cjs                   # all-in-one local CI runner (`npm run check:github`)
│   ├── auto-label-issue.cjs               # 50-char label truncation, add/remove reconciliation, expanded languages
│   ├── auto-label-issue.test.cjs          # 14 unit tests (50-char invariant, CJK/Arabic, reconciliation, CLI, renderer)
│   ├── check-plugin-request-site.cjs      # plugin-request URL validation, reachability check, theme label reconciliation & live-issue auto-close
│   ├── check-plugin-request-site.test.cjs # 10 unit/integration tests (URL/IP guards, curl probe, theme label plan, edit/live-recheck guards, CLI)
│   ├── check-bug-report-site.cjs          # bug & domain-changed plugin site lookup, candidate URL extraction & unreachable auto-close
│   ├── check-bug-report-site.test.cjs     # 8 unit/integration tests (373-plugin coverage, domain-changed extraction, guardrails, CLI)
│   ├── validate-issue-template.cjs        # validates Report Issue / Request Plugin / Request Feature forms & live issue recheck
│   ├── validate-issue-template.test.cjs   # 16 unit tests (valid/invalid forms, live-issue recheck, headings, checkboxes, YAML drift guard)
│   ├── generate-issue-index.cjs           # reuses issue-parsing.cjs & buildSelectionMatcher
│   ├── generate-issue-index.test.cjs      # 2 unit tests for full & incremental index updates
│   ├── generate-issue-template-options.cjs# exports renderIssueTemplate; guards main() behind require.main
│   └── blank_report_issue.yml             # placeholder 2.1.4 + latest release link
├── ISSUE_TEMPLATE/
│   └── request_feature.yml                # removes stale 1.1.19 version link -> releases/latest
└── workflows/
    ├── issue_auto_label.yml               # triggers on opened/edited/labeled; syncs add/remove labels via API
    ├── theme_auto_label.yml               # SSRF-safe reachability + unreachable auto-close + managed theme label add/remove reconciliation
    ├── issue_moderator.yml                # live-issue template validation + bug/domain-change reachability auto-close + SHA-pinned moderator
    ├── generate-issue-index.yml           # watches issue-parsing.cjs
    └── github-scripts-check.yml           # PR CI: script tests + clean-tree guard, ESLint/Prettier, validate-github-yaml.py, actionlint
package.json                               # adds test:scripts & check:github; adds cjs/mjs to format/format:check & lint-staged
AGENTS.md                                  # adds .github/scripts pointer (`test:scripts`, `check:github`) & sharpens CODING_STANDARDS trigger
CODING_STANDARDS.md                        # adds concise GitHub workflows & scripts standards

Key fixes:

  • Stop spawning bare plugin: labels, fix CJK/Arabic matching & enforce GitHub 50-char limit: auto-label-issue.cjs shares matchPluginEntries / buildSelectionMatcher via issue-parsing.cjs (handling \u200e LRM Arabic controls, comma-containing Chinese/Korean prefixes, and colons inside names like Re:Library), truncates long plugin labels to <= 50 chars while preserving [cleanId] for generate-issue-index.cjs (preventing batch API 422 errors across all 374 keys.json entries), and computes { add, remove } reconciliation (computeLabelPlan) on opened, edited, and labeled.
  • Enable language: auto-labeling on plugin requests: expands LANGUAGE_ALIASES (+10 languages + delimited primary language parsing), preserves manually added unlisted language: * labels via MANAGED_LANGUAGE_LABELS, and safely pre-creates missing language: * labels with #ADD8E6.
  • Pre-connection SSRF-safe reachability, auto-close unresponsive plugin request sites & theme auto-labeler hardening: site-reachability.cjs resolves all DNS records before connecting, blocks if any record is private/loopback/dual-homed before invoking curl, fails over across up to 4 validated public IPs per hop pinned via --resolve, stops at the first HTTP response (maxRedirs: 0) for reachability checks so 3xx redirects count as reachable even if the redirect target fails, and walks redirects hop-by-hop for theme probes; check-plugin-request-site.cjs + theme_auto_label.yml (cancel-in-progress: false so non-URL edits don't cancel initial checks) probe HTTPS/HTTP with 1 retry, treat HTTP 100..599 (including Cloudflare 403/503) as reachable, fail safe on TLS cert errors and private IPs, re-check the live GitHub issue before closing via close-invalid-issue.cjs, run all 6 theme probes (madara, lightnovelwp with lighnovelwp fallback, hotnovelpub, fictioneer, novel fire, readwn) through the same SSRF-safe helper, and reconcile (add/remove) managed theme: * labels on edits via computeThemeLabelPlan while preserving manual unmanaged labels.
  • Auto-close unresponsive bug and Domain Changed reports (check-bug-report-site.cjs in issue_moderator.yml): on opened and edited open bug issues (after duplicate moderation and skipping OWNER/MEMBER/COLLABORATOR/Bot, unchanged targets on edited, and dynamic komga), resolves plugin site URLs from plugins/ (373/374 keys.json entries) for regular bug reports or extracts candidate new URL(s) from descriptive sections (excluding old domain & subdomain apexes on non-shared hosts, screenshots, and meta links, without skipping bare domains when explicit URLs appear) for Domain Changed reports; when all target URLs fail to respond over HTTPS and HTTP, re-checks the live issue (including the unresolved-plugin guard) before closing as not_planned with invalid and website-owner / Domain Changed guidance (with geo-block appeal notes).
  • Live-issue template auto-close & moderator cleanup: issue_moderator.yml fetches the live issue (--issue-file) before validate-issue-template.cjs decides to close via close-invalid-issue.cjs (preventing stale opened-event close races when an author fixes a form immediately after opening), replaces obsolete Markdown rules, pins tachiyomiorg/issue-moderator-action@32a31ab12ad6e68ebf4c65408f47bef132d4fd3c # v2, gates generate-issue-index.yml dispatches on actual post-moderation state/labels changes, and updates blank_report_issue.yml / request_feature.yml to releases/latest.
  • Hardened .github/ CI & local parity (github-scripts-check.yml, check:github, CODING_STANDARDS.md): triggers on PRs without a workflow-level paths: filter (safe as a Required Status Check via an in-job fetch-depth: 2 .github/ diff gate), enforces clean-tree after node --test, Prettier + ESLint (--max-warnings 0) on .github/scripts/*.cjs, shared validate-github-yaml.py (UniqueKeyLoader + Issue Form schema validation on renderIssueTemplate(blank_report_issue.yml, keys.json)), direct report_issue.yml PR-edit guard, SHA-256-verified actionlint v1.7.12, local npm run check:github parity (check-github.cjs), .cjs/.mjs in format/format:check, and ## GitHub workflows & scripts rules in CODING_STANDARDS.md.

Evidence

  • pnpm run check:github (node .github/scripts/check-github.cjs --require-actionlint):
    • node --test .github/scripts/*.test.cjs: 56/56 passing (14 auto-label/template-renderer + 6 shared SSRF/failover/theme/close-API + 10 plugin-request reachability/theme-plan + 8 bug/domain-change reachability + 2 issue-index + 16 template-validation & YAML schema drift-guard tests)
    • Prettier + ESLint (--max-warnings 0) on .github/scripts/*.cjs: 0 errors, 0 warnings
    • validate-github-yaml.py (UniqueKeyLoader + Issue Form schema): 16/16 YAML files validated (including rendered blank_report_issue.yml)
    • actionlint across all .github/workflows/*.yml: 0 errors, 0 warnings

Merge Danger

Door: Two-way

Only .github/ workflows/scripts/templates, package.json, AGENTS.md, and CODING_STANDARDS.md are modified; no plugin source files, built manifests, .husky/pre-commit, or generated report_issue.yml are touched. theme_auto_label.yml checks for theme: lightnovelwp and falls back to theme: lighnovelwp if present, avoiding duplicate label creation on merge.

Blast Radius: Narrow

Limited to GitHub issue/PR automation, documentation, and local test/lint scripts.

Optional maintainer GitHub UI cleanup after merge:

  • Delete the stray empty plugin: label.
  • Rename theme: lighnovelwp -> theme: lightnovelwp.

AI-assisted (Antigravity / Gemini).

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5 · Fix the incomplete domain collection before merging; it can close reports that include a working new website.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect GitHub issue labeling, moderation, and repository checks.

Fix the incomplete domain collection before merging; it can close reports that include a working new website.

Findings

  1. P1 Working domains get skipped ▶
  2. P2 Label updates get cancelled ▶

Summary

This PR replaces shell-based issue automation with shared scripts and adds checks for GitHub workflows and forms.

  • Issue labels stay in sync with the report and its selected plugin.
  • Plugin requests check whether the submitted site responds and which theme it uses.
  • Bug reports check plugin sites and proposed replacement domains.
  • New issues are checked against the report, plugin, and feature forms.
  • GitHub scripts and workflow files get matching local and pull-request checks.

Previous-thread review:

  • The live issue read addresses the stale opening-event close.
  • Multiple public addresses are now tried, and reachability checks stop at redirects.
  • Managed theme labels are reconciled.
  • 7ui77 manually resolved all seven earlier threads without explanatory replies: fixed issues getting closed, working addresses being ignored, redirect responses being lost, old theme labels remaining, certificate errors being lost, retries outlasting the moderator job, and temporary failures erasing theme labels. None supplied a Comment number, so none has a numbered ledger entry.

Reviews (6) · Last reviewed commit: "chore(github): remove stale actionlint i..." · Reviewed by Greptile

Comment thread .github/workflows/issue_moderator.yml Resolved
Comment thread .github/scripts/site-reachability.cjs Resolved
Comment thread .github/scripts/site-reachability.cjs Resolved
Comment thread .github/workflows/theme_auto_label.yml Resolved
@greptile-apps

greptile-apps Bot commented Nov 28, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

7ui77 and others added 3 commits November 28, 2026 21:52
… theme labels

Co-Authored-By: Gemini <gemini@google.com>
…iliation standards

Co-Authored-By: Gemini <gemini@google.com>
Comment thread .github/scripts/site-reachability.cjs Resolved
Comment thread .github/scripts/site-reachability.cjs Resolved
while ((bareMatch = bareDomainRegex.exec(bareScanText)) !== null) {
const token = bareMatch[1];
const tld = token.split('.').pop().toLowerCase();
if (!UNAMBIGUOUS_BARE_TLDS.has(tld)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Working domains get skipped

A domain-change report mentioning a dead https://old-mirror.example/ and a working bare novel.to keeps only the dead URL because to is not in UNAMBIGUOUS_BARE_TLDS. The checker then treats that partial list as every submitted URL and closes the report.

Recognize valid bare domains, or skip automatic closure when some domain-like text was left unchecked.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

types:
- opened
- edited
- labeled

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Label updates get cancelled

If a maintainer adds an unrelated label during an active label update, the new labeled run shares the same concurrency group and cancels it through cancel-in-progress: true. The replacement job then skips labels other than bug and plugin request, so nothing finishes the update. This can leave missing or stale labels until another edit.

Filter unrelated events before they share the group, or avoid cancelling active updates.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant